package bk;

import java.io.*;

public class TriangleFile
{
	public static void main(String[] args) 
		throws IOException, ClassNotFoundException  { 	
	Triangle t1 = new Triangle(new Point(-1,0), new Point(1, 0), new Point(0, 1));
	
	ObjectOutputStream out = new 	ObjectOutputStream(new FileOutputStream 	("myObjectFile"));
	out.writeObject(t1);
	out.close();
	
	ObjectInputStream in = new ObjectInputStream (new FileInputStream ("myObjectFile"));
	
	Triangle t2 = (Triangle) in.readObject();
	
	System.out.println(t2.toString());
	in.close();
   }  
} 
